/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 日志管理
module.exports = [
  // 操作日志
  {
    url: '/v1/admin-log$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 49,
            'content': '系统管理员进行了“缓存清除“操作。',
            'request_uri': 'v1/cache/clear',
            'request_method': 'DELETE',
            'request_parameters': '[]',
            'request_ip': '180.149.130.16',
            'request_user_agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36',
            'request_browser': 'Chrome 98.0.4758.102',
            'request_platform': 'Windows 10.0',
            'action': 'App\\Http\\Controllers\\CacheController@clear',
            'action_controller': 'App\\Http\\Controllers\\CacheController',
            'action_controller_name': '缓存管理',
            'action_method': 'clear',
            'action_method_name': '缓存清除',
            'route_as_name': 'admin.cache.clear',
            'response': '{"status":1,"code":200,"message":"清除成功。","data":[]}',
            'exception': '',
            'status': 1,
            'created_user_name': '系统管理员',
            'created_at': '2022-03-01 20:34:56'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 1
        }
      }
      return success(result)
    }
  },
  // 登录日志
  {
    url: '/v1/admin-log/login$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 91,
            'content': '演示账号进行了“登录“操作。',
            'request_ip': '27.129.239.156',
            'request_browser': 'Chrome 98.0.4758.102',
            'request_platform': 'Windows 10.0',
            'response': '{"status":1,"code":200,"message":"登录成功。","data":{"token":"******"}}',
            'status': 1,
            'created_user_name': '演示账号',
            'created_at': '2022-03-03 16:37:40'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 1
        }
      }
      return success(result)
    }
  }
]
